package com.njym.java.util; /**
 * @Title: LiveTypeEnum
 * @ProjectName family-benefit
 * @Description: TODO
 * @author 71705
 * @date 2019/12/2415:08
 */

import io.swagger.annotations.ApiModel;

/**
 * @program: family-benefit
 *
 * @description:
 *
 * @author: lijie
 *
 * @create: 2019-12-24 15:08
 **/
@ApiModel(description = "直播类型")
public enum  LiveTypeEnum {

    course("course", "课程");

    LiveTypeEnum(String value, String text) {
        this.value = value;
        this.text = text;
    }

    private String value;
    private String text;

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    /**
     * 根据value获取text
     *
     * @param value
     * @return
     */
    public static String getTextByValue(String value) {
        LiveTypeEnum[] dictTypeEnums = LiveTypeEnum.values();
        for (LiveTypeEnum dictTypeEnum : dictTypeEnums) {
            if (dictTypeEnum.getValue().equals(value)) {
                return dictTypeEnum.getText();
            }

        }
        return "";
    }

}
